package com.mice.microserviceconsumer;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by AmbitiousMice on 2018/9/14.
 */
@Configuration
public class RibbonConfiguration {

    /**
     * 自定义定义ribbon的负载均衡策略
     * @return
     */
    @Bean
    public IRule ribbonRule(){
        return new RandomRule();
    }
}
